<?php

abstract class AbstractTWLPagesFactory extends AbstractSingleton {

    final public function displayContent() {

        $hRssFeeds = Settings::config('system')->getSection('rss');

        $path = Url::createCurrent()->getPath();

        if (isset($hRssFeeds[$path])) {

            Url::setCurrent( Url::createOnSite($hRssFeeds[$path]) );
            $oPage = $this->createPageByPath( Url::createCurrent()->getPath() );

            $oPage->getController()->displayRss();

        } else {

            $this->createPageByPath($path)->getController()->displayPage();
        }
    }

    abstract protected function createPageByPath($path);
}

?>